// utils/auth.js
export function getUserInfo() {
    const userId = sessionStorage.getItem('empId');
    const userRole = sessionStorage.getItem('role');
    if (!userId || !userRole) {
      throw new Error('无法获取当前用户ID或角色，请重新登录');
    }
    return { userId, userRole };
  }
  